<template>
  <div class='list_box'>
    <!-- child
    <!-- <my-child /> 
    {{qqq}}{{www}}{{aaa}}
    <button @click='change'>把父亲的name变量换成“你好世界”</button> -->

    <ul>
      <li v-for='item in list'>
        {{item.t}}
        <template v-if='item.children&&item.children.length'>
          <img
            :src="url"
            alt=""
          >
          <my-child :list='item.children' />
        </template>
      </li>
    </ul>
  </div>
</template>
<script>
// @ is an alias to /src
export default {
  name: "my-child", // 不能是已经存在的html标签
  props: ["qqq", "www", "aaa", "list"], // 这里的属性是只读的
  data() {
    return {
      url: "https://pics3.baidu.com/feed/e7cd7b899e510fb3258d8542d3ef239dd3430cb7.jpeg?token=3617c1deee130238322d95a8d954be2c",
    };
  },
  methods: {
    change() {
      // this.aaa = "你好世界";
      this.$emit("qqfn", "你好世界");
    },
  },
};
</script>
<style lang="less">
</style>